﻿using Framework.Email;
using Framework.Security;
using Framework.Validation;
using Interfaces.Infrastructure;
using Interfaces.Validation;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Unity;

namespace Framework
{
    public class GenericModule : IModule
    {
        private readonly IUnityContainer _container;

        public GenericModule(IUnityContainer container)
        {
            _container = container;
        }
        
        public void Initialize()
        {
            _container.RegisterType<IValidator, GenericValidator>();
            _container.RegisterType<ITiketSerializer, CustomSessionTiketSerializer>();
            _container.RegisterType<IHashService, Md5HashService>();
            _container.RegisterType<IEncriptionService, RijndaelEncriptionService>();
            _container.RegisterType<IPasswordGeneratedService, PasswordGeneratedService>();
            _container.RegisterType<IEmailService, EmailService>();
        }
    }
}
